package org.idea.qiyu.framework.apm.agent.core.jdbc;


import java.util.Arrays;

/**
 * jdbc相关的统计对象
 *
 * @Author linhao
 * @Date created in 2:18 下午 2021/7/19
 */
public class JdbcStatisticsObject {

    /**
     * 链路id
     */
    private String traceId;

    /**
     * jdbcUrl
     */
    private String jdbcUrl;

    /**
     * sql 语句内容
     */
    private String querySql;

    /**
     * sql 执行开始时间
     */
    private long begin;

    /**
     * sql 执行结束时间
     */
    private long end;

    /**
     * 耗时
     */
    private long count;

    /**
     * 参数类型
     */
    private String[] paramsType;

    /**
     * 参数数组
     */
    private Object[] params;

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    public String getQuerySql() {
        return querySql;
    }

    public void setQuerySql(String querySql) {
        this.querySql = querySql;
    }

    public long getBegin() {
        return begin;
    }

    public void setBegin(long begin) {
        this.begin = begin;
    }

    public long getEnd() {
        return end;
    }

    public void setEnd(long end) {
        this.end = end;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public String[] getParamsType() {
        return paramsType;
    }

    public void setParamsType(String[] paramsType) {
        this.paramsType = paramsType;
    }

    public Object[] getParams() {
        return params;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }

    @Override
    public String toString() {
        return "JdbcStatisticsObject{" +
                "traceId='" + traceId + '\'' +
                ", jdbcUrl='" + jdbcUrl + '\'' +
                ", querySql='" + querySql + '\'' +
                ", begin=" + begin +
                ", end=" + end +
                ", count=" + count +
                ", paramsType=" + Arrays.toString(paramsType) +
                ", params=" + Arrays.toString(params) +
                '}';
    }
}
